import { defineStore } from "pinia";

export interface EnvStoreState {
	token: string;
}

export interface EnvSotreActions {
	setToken: (this: EnvStoreState, data: string) => void;
}

// eslint-disable-next-line @typescript-eslint/no-unused-vars
export interface EnvStoreGetters<T = EnvStoreState> {
	[key: string]: any;
}

export const useGlobalStore = defineStore<string, EnvStoreState, EnvStoreGetters, EnvSotreActions>("global", {
	state: () => ({
		token: ""
	}),

	getters: {},

	actions: {
		setToken(this: EnvStoreState, data: string) {
			this.token = data;
		}
	}
});
